<template>
  <view>
    <view class="myInviteTeachers-page-main">
      <view class="myInviteTeachers-page-main-item" v-for="(item, index) in list" :data-id="item.id" :key="index">
        <view class="myInviteTeachers-page-main-item-header">
          <view class="_item-header-title"><text>{{item.gpinfoName}}</text></view>
        </view>

        <view class="myInviteTeachers-page-main-item-content">
          <view class="myInviteTeachers-page-main-item-content-inner">
            <view class="_content-inner-img"><img class="_img" :src="getImage(item.gpinfoLogo)" mode="aspectFit"></img></view>
            <view class="_content-inner-detail">
              <view class="_content-inner-detail-item">
                <view class="_content-inner-detail-item-info">
                  <text class="text" v-if="isType==='2'">{{item.gpinfoIntroduce}}</text>
                  <view class="box1_text" v-if="isType==='2'"><view class="isType-yy">原因</view>{{item.usergpinfoapplyResult}}</view>
                </view>
              </view>
            </view>
          </view>
        </view>

        <view class="myInviteTeachers-page-main-item-bottom">
          <view class="myInviteTeachers-page-main-item-bottom-text"><text>{{isType==='1'?'申请':'入群'}}时间：{{item.createTime}}</text></view>
          <view class="myInviteTeachers-page-main-item-bottom-text"><text :class="item.usergpinfoapplyStatus=='2' ?'btn tg':'btn btg'">{{item.usergpinfoapplyStatus}}</text></view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import {getImage,getgpinfoapplyStatus} from '@/common/type'
export default {
  props:{
    //入群，还是创建时间的状态
    isType:{
      type:String,
      default(){
        return '1'
      }
    },
    //数据
    list:{
      type:Array,
      default () {
        return []
      }
    }
  },
  methods:{
    getImage(e) {
      return getImage(e)
    },
    getgpinfoapplyStatus(status){
      return getgpinfoapplyStatus(status)
    },
  }
}
</script>

<style lang="scss" scoped>
.box1_text{
  background-color: #f3f3f3;
  text-align: left;
  padding: 20rpx;
  border-radius: 20rpx;
}
.isType-yy{
  font-size: 24rpx;
  padding: 5rpx 20rpx;
  border-radius: 30rpx;
  color: #fff;
  background-color: #dd524d;
  line-height: 24rpx;
  margin-right: 20rpx;
  display: inline;
  text-align: center;
}
.myInviteTeachers-page{
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 200rpx;
  background-color: #efeff4;
  line-height: 42rpx;
  min-height: 100vh;
  .btn{
    font-size: 24rpx;
    padding: 10rpx 20rpx;
    border-radius: 30rpx;
    color: #fff;
  }
  .tg{
    background-color: #2AC845;
  }
  .btg{
    background-color: #dd524d;
  }
  .top-fixed{
    position: fixed;
    top: 0;
    z-index: 1;
  }
  .top{
    width: 100%;
    height:100rpx;
    padding:0 30rpx;
    // background-color: #007AFF;
    background-color: #f7f7f7;
    box-shadow: 0 1px 6rpx #ccc;
    display:flex;
    justify-content:space-between;
    align-items: center;
    box-sizing: border-box;
    .top-text{
      color:#000;
      font-size:34rpx;
    }
  }
  .top-box{
    width: 100%;
    height: 100%;
    position: relative;
    text-align: center;
    line-height: 100rpx;
    .back-img{
      width:44rpx;
      height:40rpx;
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      margin:auto;
      margin-left: 0rpx;
    }
  }
  .myInviteTeachers-page-main{
    width: 100%;
    padding: 0 20rpx;
    box-sizing: border-box;
    .myInviteTeachers-page-main-item{
      width: 100%;
      border-radius: 4rpx;
      background-color: white;
      background-clip: padding-box;
      box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
      margin-top: 30rpx;
      .myInviteTeachers-page-main-item-header{
        position: relative;
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        min-height: 88rpx;
        padding: 20rpx 30rpx;
        box-sizing: border-box;
        -webkit-box-pack: justify;
        -webkit-justify-content: space-between;
        justify-content: space-between;
        -webkit-box-align: center;
        -webkit-align-items: center;
        align-items: center;
        font-size: 34rpx;
        border-radius: 4rpx 4rpx 0 0;
        border-bottom: 1px solid rgba(200,199,204,0.5);
        ._item-header-title{

        }
      }
      .myInviteTeachers-page-main-item-content{
        font-size: 28rpx;
        position: relative;
        .myInviteTeachers-page-main-item-content-inner{
          position: relative;
          padding: 30rpx;
          box-sizing: border-box;
          display: flex;
          flex-wrap: nowrap;
          justify-content: flex-start;
          ._content-inner-img{
            width: 160rpx;
            border-radius: 10rpx;
            ._img{
              width: 100%;
              border-radius: 10rpx;
            }
          }
          ._content-inner-detail{
            width: calc(100% - 160rpx);
            ._content-inner-detail-item{
              ._content-inner-detail-item-badge{
                margin-left: 20rpx;
                ._content-inner-detail-item-badge-text{
                  margin: 0 10rpx;
                  font-size: 24rpx;
                  padding: 10rpx 20rpx;
                  background-color: #F0AD4E;
                  color: #fff;
                  border-radius: 40rpx;
                  box-sizing: border-box;
                }
              }
              ._content-inner-detail-item-info{
                text-indent: 2em;
                padding: 0 0 0 20rpx;
                box-sizing: border-box;
              }
              ._content-inner-detail-item-info text{
                display: -webkit-box;
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 3;
                overflow: hidden;
                overflow-y: scroll;
                max-height: 150rpx;
              }
            }
          }
        }
      }
      .myInviteTeachers-page-main-item-bottom{
        position: relative;
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        min-height: 88rpx;
        padding: 20rpx 30rpx;
        box-sizing: border-box;
        -webkit-box-pack: justify;
        -webkit-justify-content: space-between;
        justify-content: space-between;
        -webkit-box-align: center;
        -webkit-align-items: center;
        align-items: center;
        border-top: 1px solid rgba(200,199,204,0.5);
        .myInviteTeachers-page-main-item-bottom-text{
          color: #6d6d72;
          border-radius: 0 0 4rpx 4rpx;
          font-size: 28rpx;
        }
      }
    }
  }
}
</style>
